import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'
// 异步
const Hesuan = () => import('../views/Hesuan/index.vue')
const Area = () => import('../views/Area/Area.vue')
const Prevention = () => import('../views/Prevention/index.vue')
const CovNumber = () => import('../views/Home/CovInfo/CovNumber.vue')
const Check = () => import('../views/Home/CovInfo/Check.vue')
const Navigation = () => import('../views/Home/Navigation.vue')
const Citys = () => import('../views/Citys/Citys.vue')
const Travel = () => import('../views/Travel/Travel.vue')

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/navigation',
    name: 'Navigation',
    component: Navigation
  },
  {
    path: '/hesuan',
    name: 'Hesuan',
    component: Hesuan
  },
  {
    path: '/area',
    name: 'Area',
    component: Area
  },
  {
    path: '/prevention',
    name: 'Prevention',
    component: Prevention
  },
  {
    path: '/covNumber',
    name: 'CovNumber',
    component: CovNumber
  },
  {
    path: '/check',
    name: 'Check',
    component: Check
  },
  {
    path: '/citys/:cityname',
    name: 'Citys',
    component: Citys,
    props: true,
  },
  {
    path: '/travel',
    name: 'Travel',
    component: Travel,
  },
]

const router = new VueRouter({
  routes
})

export default router
